package net.lzzy;

import java.io.*;

public class Encryption {
    public static void main(String[] args) throws IOException{
        try(
                BufferedInputStream input = new BufferedInputStream(
                        new FileInputStream("a.txt"));

                BufferedOutputStream output = new BufferedOutputStream(
                        new FileOutputStream("b.txt"));
                ) {
            int a;
            while ((a= input.read())!=-1){
                output.write(a+5);
            }
        }

        try(
                BufferedInputStream input = new BufferedInputStream(
                        new FileInputStream("b.txt"));

                BufferedOutputStream output = new BufferedOutputStream(
                        new FileOutputStream("c.txt"))
        ) {
            int a;
            while ((a= input.read())!=-1){
                output.write(a-5);
            }
        }

    }
}
